package com.financial.business.service.impl;

import com.financial.business.constants.HeemoneyBusinessEnumConstants;
import com.financial.business.service.HeemoneyBusinessService;
import com.financial.business.service.FinancialReportHeemoneyService;
import com.financial.business.util.JsonUtils;
import com.financial.business.util.apiresult.ApiResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author WANGNING
 * @email wyn20140226@aliyun.com
 * @tar 汇收银业务处理
 * @date 2019/11/5 13:54
 * @apiGroup heemoney-business
 * @apiVersion 2.0.0
 */
@Service
public class HeemoneyBusinessServiceImpl implements HeemoneyBusinessService {
    private static Logger logger = LoggerFactory.getLogger(HeemoneyBusinessServiceImpl.class);
    @Autowired
    private FinancialReportHeemoneyService financialReportHeemoneyService;

    @Override
    public ApiResult merchRegister(String requestParam) {
        logger.info("金融中心汇收银业务模块接收商户基础信息简要注册:{}",requestParam);
        Map<String, Object> condMap = JsonUtils.jsonToMap(requestParam);
        String reportType = (String) condMap.get("report_type");
        logger.info("HeemoneyBusinessServiceImpl----金融中心汇收银基类，获取报备类型：{}" ,reportType);
        ApiResult apiResult = ApiResult.failure(HeemoneyBusinessEnumConstants.ENUM_REPORTTYPE_ERROR);
        if (reportType.equalsIgnoreCase(HeemoneyBusinessEnumConstants.ENUM_REPORTTYPE_REGISTER)) {
            //汇收银商户简要注册
            apiResult = financialReportHeemoneyService.HeemoneyMerchRegister(requestParam);
        }
        return apiResult;
    }

    @Override
    public ApiResult report(String requestParam) {
        return null;
    }

    @Override
    public ApiResult pay(String requestParam) {
        return null;
    }

    @Override
    public ApiResult split(String requestParam) {
        return null;
    }

    @Override
    public ApiResult refund(String requestParam) {
        return null;
    }

    @Override
    public ApiResult withdrawal(String requestParam) {
        return null;
    }

    @Override
    public ApiResult payment(String requestParam) {
        return null;
    }


}
